Skip to content

feat: back up biometrics.db and add --restore flag #347#358

Open
ng wants to merge 1 commit intodevfrom
fix/347-db-backup
Open

feat: back up biometrics.db and add --restore flag #347#358
ng wants to merge 1 commit intodevfrom
fix/347-db-backup

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Apr 4, 2026

Summary

  • Back up biometrics.db alongside sleepypod.db before migrations, using a shared timestamp so paired backups match
  • Add --restore flag that lists available .db.bak.* files sorted newest-first with human-readable timestamps and sizes, lets the user pick one to restore
  • Prune backups to keep only the 5 most recent per database

Closes #347

Test plan

  • Run scripts/install --restore with no backups present — should print "No backups found"
  • Run a normal install with both DBs present — verify both get .bak.<timestamp> copies
  • Create >5 backups for one DB — verify oldest are pruned
  • Run --restore, pick a backup — verify the DB file is replaced
  • Verify bash -n scripts/install passes (syntax check)

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 4, 2026

Warning

Rate limit exceeded

@ng has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 8 minutes and 26 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 8 minutes and 26 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: dfdfb0a9-e39f-4339-8c04-55eda31948ae

📥 Commits

Reviewing files that changed from the base of the PR and between 321635f and 8ae3650.

📒 Files selected for processing (1)
  • scripts/install
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/347-db-backup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@ng ng mentioned this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add biometrics.db backup and --restore flag to install script

1 participant